<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="js/layui/css/layui.css">
</head>
<body>
<form class="layui-form" action="" style="padding: 10px">
    <div class="layui-form-item">
        <label class="layui-form-label">景点名称</label>
        <div class="layui-input-block">
            <input type="text"id="name" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">景点简介</label>
        <div class="layui-input-block">
            <input type="text" id="desc" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">景点地址</label>
        <div class="layui-input-block">
            <input type="text" id="address"class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">所属城市</label>
            <div class="layui-input-inline">
                <input type="tel" id="city" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">景点星级</label>
            <div class="layui-input-inline">
                <input type="text" id="star"class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">开放日期</label>
            <div class="layui-input-inline">
                <input type="tel" id="opendate" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">开放时间</label>
            <div class="layui-input-inline">
                <input type="text" id="opentime"class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">经度</label>
            <div class="layui-input-inline">
                <input type="tel"id="longitude" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">纬度</label>
            <div class="layui-input-inline">
                <input type="text" id="latitude" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">创建时间</label>
            <div class="layui-input-inline">
                <input type="text" id="addtime" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">详细介绍</label>
        <div class="layui-input-block">
            <textarea type="text" id="content" class="layui-input" style="min-height: 100px"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">景点相册</label>
        <div class="layui-input-block" id="imgs">
        </div>
    </div>
</form>
<script src="js/jquery-1.8.1.min.js"></script>
<script src="js/layui/layui.js"></script>
<script>
    var data=JSON.parse(localStorage.getItem("data"));
    $("#desc").val(data.description);
    $("#name").val(data.tourist_name);
    $("#city").val(data.city_name);
    $("#longitude").val(data.longitude);
    $("#latitude").val(data.latitude);
    $("#opendate").val(data.opendate);
    $("#opentime").val(data.opentime);
    $("#content").val(data.content);
    $("#address").val(data.address);
    $("#star").val(data.star);
    var date = new Date(data.createtime);
    $("#addtime").val(date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+(date.getHours()>9?date.getHours():"0"+date.getHours())+":"+( date.getMinutes()>9?date.getMinutes():"0"+date.getMinutes())+":"+ ( date.getSeconds()>9?date.getSeconds():"0"+date.getSeconds()));
    var string=data.gallery.split(",");
    for(var i=0;i<string.length-1;i++){
        $("#imgs").append( "<img style='width: 150px;height: 300px' src="+'http://'+window.location.host+string[i]+">")
    }
    layui.use(['form'], function () {
        var form = layui.form
    });
</script>
</body>
</html>